import java.io.IOException;
import java.net.UnknownHostException;

import thothCommonClasses.*;

public class QueryInterface {
	public DataList resultData; 
	public static void WaitSocket() throws IOException
	{
		//need deserialize socket as Header
		communicator comm = new communicator();
		Header header = comm.GetHeader();
				System.out.println(header.type);
		
		if(header.type == Header.HeaderType.GET)
		{
			System.out.println("Inside get");
			//deserialize socket as parameters with condition	 
			
			Parameters param = comm.GetParameters();
			System.out.println("Query inforamtion :" + param.toString());
			
			DataList dataList = dataaccess.getInformation(param);
			
		}	 
		
		else if (header.type == Header.HeaderType.PUT)
		{
			//deserialize socket as DataList
			DataList dataList = comm.GetDataList();
			
			//store dataList
			for(int i=0;i<dataList.list.size();i++)
			{
				Data data = dataList.list.get(i);
				//store information
			}
		}
		
		comm.CloseConection();
	}
	
	private Header deserializeHeader()
	{
		Header retVal = null;
		
		
		
		return retVal;
	}
	
	private DataList deserializeDataList()
	{
		DataList retVal = null;
		
		return retVal;
	}
	
	public static void main(String args[])
	{
		try {
			WaitSocket();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
